/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.mzk.kramerius.fedoraaccess;

import cz.mzk.kramerius.commons.PropertyLoader;
import cz.mzk.kramerius.fedoraaccess.cli.PropertyNames;
import java.io.File;
import java.io.IOException;

/**
 *
 * @author Martin Řehánek <rehan at mzk.cz>
 */
public class FedoraServer {

    private final String url;
    private final String login;
    private final String password;

    public FedoraServer(File propertiesFile) throws IOException {
        this(new PropertyLoader(propertiesFile.getAbsolutePath()));
    }

    public FedoraServer(PropertyLoader propertyLoader) throws IOException {
        url = propertyLoader.loadString(PropertyNames.FEDORA_URL);
        login = propertyLoader.loadString(PropertyNames.FEDORA_LOGIN);
        password = propertyLoader.loadString(PropertyNames.FEDORA_PASSWORD);
    }

    public FedoraServer(String url, String login, String password) {
        this.url = url;
        this.login = login;
        this.password = password;
    }

    /**
     * @return the url
     */
    public String getUrl() {
        return url;
    }

    /**
     * @return the login
     */
    public String getLogin() {
        return login;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }
}
